
function wyj() {
    //用户名称
    var username = document.getElementById("username").value;
    var cellphone = /^[\w-]{4,16}$/;
    if (cellphone.test(username)) {
    } else {
        alert("用户名称验证失败");
    }
    //密码
    var password = document.getElementById("password").value;
    var cellphonem = /^[\w-]{4,16}$/;
    if (cellphonem.test(password)) {
    } else {
        alert("密码验证失败");
    }
    //确认密码
    var passwordd = document.getElementById("passwordd").value;
    var cellphonemn = /^[\w-]{4,16}$/;
    if (cellphonemn.test(passwordd) == cellphonemn.test(passwordd)) {
    } else {
        alert("确认密码验证失败");
    }

    //手机号
    var phone = document.getElementById("phone").value;
    var cellphonea = /^(13|14|15|17|18)\d{9}$/;
    if (cellphonea.test(phone)) {
    } else {
        alert("手机号验证失败");
    }
    //身份证号
    var card = document.getElementById("card").value;
    var cellphoneb = /^[1-9]\d{5}(?:18|19|20)\d{2}(?:0[1-9]|10|11|12)(?:0[1-9]|[1-2]\d|30|31)\d{3}[\dXx]$/
    if (cellphoneb.test(card)) {
    } else {
        alert("身份证号验证失败");
    }



    //电子邮箱
    var mailbox = document.getElementById("mailbox").value;
    var cellphonec = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    if (cellphonec.test(mailbox)) {
    } else {
        window.alert("电子邮箱验证失败");
    }
    if (cellphone.test(username) && cellphonem.test(password) && cellphonemn.test(passwordd) && cellphonea.test(phone) && cellphoneb.test(card) && cellphonec.test(mailbox)) {
        alert("注册成功");
    } else {
        alert("注册失败")
    }

}